package com.zjitc.dao;

import com.zjitc.pojo.Orderitems;
import com.zjitc.pojo.Orders;
import org.apache.ibatis.annotations.Param;

import java.sql.SQLException;
import java.util.List;

/**
 * Create By IntelliJ IDEA
 *
 * @author: myq
 * @create-Time: 2017/11/23  15:02
 */
public interface OrderDao {

  /**
   * 添加订单
   * @param orders
   * @return
   */
  int addorder(Orders orders);

  /**
   * 添加订单详情
   * @param orderitems
   * @return
   */
  int addorderitem(@Param("orderitems") List<Orderitems> orderitems);

  /**
   * 查找用户订单
   * @param uid
   * @return
   */
  List<Orders> findOrderbyuid(@Param("uid") String uid);

  /**
   * 分页查看订单
   * @param pageid
   * @param count
   * @return
   */
  List<Orders> findlimit(@Param("pageid") int pageid, @Param("count") int count);

  /**
   * 查找订单详情
   * @param oid
   * @return
   */
  List<Orderitems> findOrderitem(@Param("oid") String oid);

  /**
   * 通过oid查看订单
   * @param oid
   * @return
   */
  Orders findOrderByoid(@Param("oid") String oid);

  /**
   * 删除订单
   * @param oid
   * @return
   */
  int deleteorder(@Param("oid") String oid);

  /**
   * 删除订单详情
   * @param oid
   * @return
   */
  int deleteorderitem(@Param("oid") String oid);

  /**
   * 更新订单
   * @param order
   * @return
   */
  int update(Orders order);

  /**
   * 查看订单数量
   * @return
   */
  int findallcount();


  /**
   * find all Orders
   * @return
   */
  List<Orders> findAll();

  /**
   删除所有订单详情
   */
  void deleteAllorderitem();
}
